﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>修改密码</title>
    <link rel="StyleSheet" href="/css/cms/main.css?<%=System.IO.File.GetLastWriteTime(Server.MapPath("/css/cms/main.css")) %>"  type="text/css" />
   <script src="/Scripts/common/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="/Scripts/common/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="/Scripts/common/util.js" type="text/javascript"></script>
    <script src="/Scripts/common/form.js" type="text/javascript"></script>
    <script src="/Scripts/cms/main.js?<%=System.IO.File.GetLastWriteTime(Server.MapPath("/Scripts/cms/main.js")) %>" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function chang() {
            var oldpwd = $("#txtoldpwd").val();
            var newpwd = $("#txtnewpwd").val();
            var confirmpwd = $("#txtconfirmpwd").val();
            $.post("/system/changpassword.html", { opwd: oldpwd, npwd: newpwd, cpwd: confirmpwd }, function (dta) {
                if (dta == "1")
                    $("#msg").text("旧密码不正确");
                if (dta == "2")
                    $("#msg").text("新密码不能为空");
                if (dta == "3")
                    $("#msg").text("确认密码不能为空");
                if (dta == "4")
                    $("#msg").text("两次密码不一致");
                if (dta == "5")
                    $("#msg").text("密码必须由4-20位的数字、字母、下划线组成");
                if (dta == "6")
                    $("#msg").text("旧密码不能为空");
                if (dta == "0") {
                    alert('密码修改成功'); location.reload();
                }
            });
        }
    </script>
</head>
<body>
      <table cellspacing="0"> 
        <tr><th colspan="3">修改密码</th></tr>      
       <tr>
            <td style="width:15%">请输入原密码：</td>
            <td><input type="password" class="w250" id="txtoldpwd" name="txtoldpwd" /></td>
        </tr>
         <tr>
            <td style="width:15%">请输入新密码：</td>
            <td><input type="password" class="w250" id="txtnewpwd" name="txtnewpwd" /></td>
        </tr>
         <tr>
            <td style="width:15%">请确认新密码：</td>
            <td><input type="password" class="w250" id="txtconfirmpwd" name="txtconfirmpwd" /></td>
        </tr>
        <tr>
            <td colspan="3"><span style="color:Red" id="msg" >&nbsp</span></td>
        </tr>
		<tr class="main-sub" id="mainsub">
			<td colspan="3"align="center">      
                <input id="btnSave" name="btnSave" onclick="chang();"  type="button" value="确认"  class="btn1" style="width:200px"  />   
            </td>
        </tr>                
 </table>
</body>
</html>
